package edu.pku.sei.act.autonomicParkingSlot.Car;

import edu.pku.sei.act.actools.util.env.ObjectProxy;
import edu.pku.sei.act.actools.util.env.TupleAllocationPolicy;
import edu.pku.sei.act.autonomicParkingSlot.ParkingSlot.ParkingSlotProxy;

public class _003 extends TupleAllocationPolicy {
	
	public _003() {
		template = new QueryingParkingSlot().toTemplate();
	}

	@Override
	public float calcPriority(ObjectProxy owner, ObjectProxy requestor) {
		if(!(owner instanceof CarProxy)||!(requestor instanceof ParkingSlotProxy))
			return 0;
		return 1/CarAdapter.calcDistance((CarProxy)owner, (ParkingSlotProxy)requestor);
	}

}
